package com.spark.userapi.feign;

import com.spark.basecommon.api.R;
import com.spark.basecommon.entity.vo.LoginUserVO;
import com.spark.userapi.feign.fallback.UserFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author fuqiang
 * @Description 用户feign
 * @Date 2020/9/30
 */
@FeignClient(value = "user-center" ,fallbackFactory = UserFallBack.class)
public interface UserFeign {

    String USER_URL_PRE = "/user";

    /**
     * 根据用户名称查询用户
     * @param username 用户名称
     * @return
     */
    @PostMapping(USER_URL_PRE + "/getUserInfoByUserName")
    R<LoginUserVO> getUserInfoByUserName(@RequestBody String username);
}
